package com.mobilepay.moneypig.utils.webview;

/**
 * Created by xlm on 2017/8/30 0030
 */

import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;

/**
 * 屏蔽广告，通过重载WebViewClient
 * <p>
 * Created by MyPC on 2017/4/18.
 */

public class NoAdWebViewClient extends WebViewClient {

    @Override
    public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
        if (ADFilterTool.hasNotAd(url)) {
            return super.shouldInterceptRequest(view, url);
        } else {
            return new WebResourceResponse(null, null, null);
        }
    }
}